function createSlice(options) {
  const { name, initialState, reducers } = options;
  // {type: 'incre', payload: 10}
  const reducer = (state = initialState, action) => {
    if (reducers.hasOwnProperty(action.type)) {
      return reducers[action.type](state, action);
    }
    return state;
  };
  // actions = {incre: payload => ({type: 'incre', payload}), decre: () => {}}
  const actions = Object.keys(reducers).reduce((result, key) => {
    result[key] = (payload) => ({
      type: `${key}`,
      payload,
    });
    return result;
  }, {});

  return {
    reducer,
    actions,
  };
}

result['add'] = payload => ({
  type: 'add',
  payload
})

let arr = ['a','b','c'];

// arr
// Response.
// response